<?php

namespace app\common\validate;

use think\Validate;

class Store extends Validate
{
	protected $rule = [
		"title" => "require",
        "logo" => "require",
        "phone" => "require",
        "username" => "require|unique:store",
        "address" => "require",
        "category_id" => "require",
        "password" => "require|min:6",
        "passwords" => "require|confirm:password",
        "agent_id" => "require",

	];
	protected $message = [
		"title.require" => "请输入商家名称",
        "logo.require" => "请上传logo",
        "phone.require" => "请输入商家电话",

        "username.require" => "请输入商家账号",
        "username.unique" => "该账号已经存在",  

        "address.require" => "请输入商家地址",
        "category_id.require" => "请选择商家分类",
        "agent_id.require" => "请选择代理商",

        "password.require" => "请输入密码", 
        "password.min" => "密码必须大于6位数", 
        "passwords.require" => "请重复确认密码",
        "passwords.confirm" => "两次输入的密码不一致",


	];

	protected $scene = [
		'add'  =>  ['title', 'logo', 'phone', 'address','category_id','password','agent_id','username'],
		'edit'  =>  ['title', 'logo', 'phone', 'address','category_id','agent_id'],
        'pass' => ['password','passwords','username'],
	];
}
